﻿<div class="wrapper border-bottom white-bg page-heading">
    <div class="col-lg-pull-12">
        <ol class="breadcrumb">
            <li class="active">商品</li>
        </ol>
    </div>
</div>
<div ng-controller="productController">
    <div class="row ui-box">
        <!--<div class="col-md-6">
            <div class="col-sm-10 input-group">
                <ui-select ng-model="query.category_id">
                    <ui-select-match placeholder="选择商品分类">{{$select.selected.name}}</ui-select-match>
                    <ui-select-choices repeat="item.id as item in category | propsFilter: {name: $select.search}">
                        <div><span ng-if="item.parent_id!=0" style="padding-left:{{20*(item.depth-1)}}px;"></span> {{item.name}}</div>
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>-->
        <div class="col-md-4">
            <div class="col-sm-10 input-group">
                <input type="text" class="form-control input-sm" ng-model="query.sku" placeholder="商品sku">
            </div>
        </div>
        <div class="col-md-4">
            <div class="input-group">
                <input type="text" class="form-control input-sm" ng-model="query.keyword" placeholder="商品名称">
                <span class="input-group-btn">
                    <a class="btn btn-primary btn-sm" ui-sref="app.product.sale_list(query)"><i class="fa fa-search"></i> 查询</a>
                </span>
            </div>
        </div>
    </div>
    <table class="table table-hover m-t-md">
        <thead>
            <tr>
                <th>名称 价格</th>
                <th width="80">库存</th>
                <th width="80">总销量</th>
                <th width="80">是否境外</th>
                <th width="100">创建时间</th>
                <th width="175" style="text-align:right">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in list.rows">
                <!--<td ng-repeat="img in item.image_path"><img ng-src="{{site.img_url+img}}" class="img-thumbnail" ng-show="item.image_path" width="60" height="60"></td>-->
                <td>
                    <div class="media">
                        <!--<div class="col-xs-3 col-md-3" ng-repeat="img in item.image_path">
                            <a href="{{site.img_url+img}}" target="_blank" class="thumbnail">
                                <img ng-src="{{site.img_url+img}}" ng-show="item.image_path" width="60" height="60">
                            </a>
                        </div>-->
                        <div class="media-left">
                            <a href="{{item.main_image_url != null? item.main_image_url : siteImg+item.image_path[0]}}" target="_blank" class="thumbnail" style="width:60px;height:60px;">
                                <img ng-src="{{item.main_image_url != null? item.main_image_url : siteImg+item.image_path[0]}}" ng-show="item.image_path" width="60" height="60">
                            </a>
                            <!--<a href="{{item.main_image_url}}" target="_blank" class="thumbnail" style="width:60px;height:60px;">
                                <img ng-src="{{item.main_image_url}}" ng-show="item.main_image_url" width="60" height="60">
                            </a>-->
                        </div>
                        <div class="media-body">
                            <p class="media-heading">{{item.name}}</p>
                            <span>{{item.price | currency:'￥'}}</span>
                        </div>
                    </div>
                </td>
                <td>{{item.stock}}</td>
                <td>{{item.sale_count}}</td>
                <td>{{item.is_seas == true? '是':'否'}}</td>
                <td>{{item.create_time}}</td>
                <td align="right">
                    <a class="btn btn-primary btn-xs" ng-click="disable(item.id)" ng-if="item.sale_status == 1"><i class="fa fa-cog"></i> 下架</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="list.total_result" items-per-page="list.size" ng-model="list.page" num-pages="list.total_pages"
                            ng-change="search_page(list.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{list.total_result}} 当前：{{list.page}}/{{list.total_pages}}</span>
        </div>
    </div>
</div>